package com.yc.cloud.mapper;

import com.yc.cloud.entity.UmsRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 后台用户角色表 Mapper 接口
 * </p>
 *
 * @author JackGu
 * @since 2022-09-11
 */
@Mapper
public interface UmsRoleMapper extends BaseMapper<UmsRole> {

    @Select(" select r.*\n" +
            "        from ums_admin_role_relation ar inner join ums_role r on ar.role_id = r.id\n" +
            "        where ar.admin_id = #{adminId}")
    List<UmsRole> getRoleList(@Param("adminId") Long adminId);


}
